﻿import request from '/@/utils/request';
enum Api {
  AddDeviceOnOffLine = '/api/deviceOnOffLine/add',
  DeleteDeviceOnOffLine = '/api/deviceOnOffLine/delete',
  UpdateDeviceOnOffLine = '/api/deviceOnOffLine/update',
  PageDeviceOnOffLine = '/api/deviceOnOffLine/page',
  DetailDeviceOnOffLine = '/api/deviceOnOffLine/detail',
  GetDeviceInfoDeviceIdDropdown = '/api/deviceOnOffLine/DeviceInfoDeviceIdDropdown',
  GetDeviceGateWayGateWayIdDropdown = '/api/deviceOnOffLine/DeviceGateWayGateWayIdDropdown',
}

// 增加设备上下线
export const addDeviceOnOffLine = (params?: any) =>
	request({
		url: Api.AddDeviceOnOffLine,
		method: 'post',
		data: params,
	});

// 删除设备上下线
export const deleteDeviceOnOffLine = (params?: any) => 
	request({
			url: Api.DeleteDeviceOnOffLine,
			method: 'post',
			data: params,
		});

// 编辑设备上下线
export const updateDeviceOnOffLine = (params?: any) => 
	request({
			url: Api.UpdateDeviceOnOffLine,
			method: 'post',
			data: params,
		});

// 分页查询设备上下线
export const pageDeviceOnOffLine = (params?: any) => 
	request({
			url: Api.PageDeviceOnOffLine,
			method: 'post',
			data: params,
		});

// 详情设备上下线
export const detailDeviceOnOffLine = (id: any) => 
	request({
			url: Api.DetailDeviceOnOffLine,
			method: 'get',
			data: { id },
		});

export const getDeviceInfoDeviceIdDropdown = () =>
		request({
		url: Api.GetDeviceInfoDeviceIdDropdown,
		method: 'get'
		});
export const getDeviceGateWayGateWayIdDropdown = () =>
		request({
		url: Api.GetDeviceGateWayGateWayIdDropdown,
		method: 'get'
		});

